package hot100;

import DTO.TreeNode;

import java.util.ArrayList;
import java.util.List;

public class inorderTraversal {
    public List<Integer> inorderTraversal(TreeNode root) {
        List<Integer> ret = new ArrayList<>();
        retcur(root,ret);
        return ret;
    }
    void  retcur(TreeNode root,List<Integer> res){
        if(root == null) {
            return;
        }
        retcur(root.left,res);
        res.add(root.val);
        retcur(root.right,res);
    }
}
